
$(document).ready(function () {
    $("#btnConfirm").click(function(){
    	$("#publishSinfoForm").submit(function(){
    		//验证类型
    		var sinfoPublishType = $("#sinfoPublishType").val();
    		if("0"==sinfoPublishType){
    			alert("类型必须选择");
    			return false;
    		}
    		var sinfoPublishTitle =$("#sinfoPublishTitle").val(); 
    		if(null == sinfoPublishTitle || ""==sinfoPublishTitle){
    			alert("信息标题必须填写");
    			return false;
    		}
    		var sinfoPublishPhone = $("#sinfoPublishPhone").val();
    		var sinfoPublishQQ = $("#sinfoPublishQQ").val();
    		var sinfoPublishEmail = $("#sinfoPublishEmail").val();
    		if((null == sinfoPublishPhone || ""==sinfoPublishPhone) && (null == sinfoPublishQQ || ""==sinfoPublishQQ) && (null == sinfoPublishEmail || ""==sinfoPublishEmail)){
    			alert("电话,QQ,邮件不能都不填写");
    			return false;
    		}
    		
    		
    		var sinfoPublishArea = $("#sinfoPublishArea").val();
    		if(null == sinfoPublishArea || ""==sinfoPublishArea){
    			alert("区县必须选择");
    			return false;
    		}
    		var imgs = $(document.getElementById('ueditor_0').contentWindow.document.body).find("img");
    		var img="";
    		imgs.each(function(){
    			var temp= $(this).attr("src");
    			if(temp!= undefined && ""!=temp){
    				if(""==img){
    					img = temp;
    				}else{
    					img = img+","+temp;
    				}
    			}			
    		});
    		//alert(img);
    		if(img != undefined && ""!=img){
    			$("#sifno_images").val(img);
    		}
    		//if(){}
    		return true;
    	}).submit();
    });
});